package com.springsource.a09Proxy.jdk.impl;

import java.lang.reflect.Method;

public class $Proxy0 implements ITarget{

    private InvocationHandler handler;

    @Override
    public int doSomething(String arg) {
        try {
            int res = (int) handler.invoke(this, doSomethingMethod, new Object[]{arg});
            return res;
        } catch (Throwable throwable) {
            throw new RuntimeException(throwable.getMessage());
        }
    }

    public $Proxy0(InvocationHandler handler) {
        this.handler = handler;
    }

    static Method doSomethingMethod;

    static {
        try {
            doSomethingMethod = ITarget.class.getMethod("doSomething", String.class);
        } catch (NoSuchMethodException e) {
            throw new RuntimeException(e.getMessage());
        }
    }
}
